﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Administrator
{
    public partial class ucRoot : UserControl
    {
        public ucRoot()
        {
            InitializeComponent();
        }
        private String RootCaption = "";

        //Заполнение полей настроек
        public void FillFields()
        {
            RootCaption = cConst.TreeCaption;
            tbCaption.Text = RootCaption;
        }
        //Применение настроек
        public Boolean ApplySetting()
        {
            if (RootCaption != "")
            {
                cConst.TreeCaption = RootCaption;
                return true;
            }
            else
            {
                MessageBox.Show(cConst.ROOT_CAPTION_ERROR_CAP, cConst.ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return false;
            }
        }

        private void tbCaption_TextChanged(object sender, EventArgs e)
        {
            RootCaption = tbCaption.Text;
        }
    }
}
